﻿//  --------------------------------
//  Copyright (c) PK Logix LLC. All rights reserved.
//  This source code is made available under the terms of the GNU General Public License version 2 (GPLv2)
//  http://www.codeplex.com/mvcclubsite/license
//  ---------------------------------

using System.Runtime.CompilerServices;
using System.Web.Mvc;
using System.Text;
using System.Linq.Expressions;

namespace MVCClubSite.Helpers
{
    public static class LabelExtension
    {
        public static string Label(this HtmlHelper helper, string target, string text)
        {
            return string.Format("<label for='{0}'>{1}</label>", target, text);
        }
    } 
  
    public static class CalendarExtensions    
    {   
  
        public static string Calendar(this AjaxHelper helper, string elementId)   
        {   
            var sb = new StringBuilder();   
  
            // Add Microsoft Ajax library   
            sb.AppendLine(helper.MicrosoftAjaxLibraryInclude());   
  
            // Add toolkit scripts   
            sb.AppendLine( helper.ToolkitInclude   
                (   
                    "AjaxControlToolkit.ExtenderBase.BaseScripts.js",   
                    "AjaxControlToolkit.Common.Common.js",   
                    "AjaxControlToolkit.Common.DateTime.js",   
                    "AjaxControlToolkit.Animation.Animations.js",   
                    "AjaxControlToolkit.PopupExtender.PopupBehavior.js",   
                    "AjaxControlToolkit.Animation.AnimationBehavior.js",   
                    "AjaxControlToolkit.Common.Threading.js",   
                    "AjaxControlToolkit.Compat.Timer.Timer.js",   
                    "AjaxControlToolkit.Calendar.CalendarBehavior.js"  
                ));   
  
            // Add Calendar CSS file   
            sb.AppendLine(helper.DynamicToolkitCssInclude("AjaxControlToolkit.Calendar.Calendar.css"));   
  
            // Perform $create   
            sb.AppendLine(helper.Create("AjaxControlToolkit.CalendarBehavior", elementId));   
  
            return sb.ToString();   
        }   
  
    }     

}